package com.xrui.hbaseview.ui;

/**
 * This is a listener interface that allows to register for messages.
 */
public interface MessageHandlerListener {

    /**
     * The method is called when a component wants to provide an additional information to the user.
     *
     * @param message The message to show to the user.
     */
    void onInfo(String message);

    /**
     * The method is called when a component wants to show the user an error.
     *
     * @param message The error message.
     * @param ex      An exception.
     */
    void onError(String message, Exception ex);

    /**
     * The method is called when a component wants to show the user message with the action.
     *
     * @param action The action to execute if clicked.
     */
    void onAction(UIAction action);
}
